#pragma once

#include "GradeIface.h"

namespace gKad {

	class MsgPing : public IListener {
	public:
		MsgPing(IAppAPI *);
		~MsgPing();

		// Send ping to destination address
		//
		bool SendPing(TGradeAddr, int);

		// Handles received data event
		//
		void __stdcall OnSendData(TAppID, IStream *);

		// compiler fix - IUnknown interface abstract methods
		HRESULT __stdcall QueryInterface(const IID &,void **);
		ULONG __stdcall AddRef(void) { return -1; };
		ULONG __stdcall Release(void) { return -1; };

	protected:
		HANDLE		waitEvent;
		void		Init();


	private:
		IAppAPI		*iApi;
		TAppID		l_appId;

	};
}